From: Victor Toso Date: Thu, 24 May 2018 13:42:47 +0000 (+0200) Subject: gdkseatdefault: Don't hide GdkWindow on grab failure X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~35^2~20 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=2c8b95a518bea2192145efe11219f2e36091b37a;p=gtk%2B3.0.git gdkseatdefault: Don't hide GdkWindow on grab failure Application is not expecting that. Bug found due gdk_seat_grab() failure on Lock Screen. When user Unlock the screen, the application is visible but does not receive enter-event any more on X11/GNOME. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1485968 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1571422 Signed-off-by: Victor Toso Signed-off-by: Carlos Garnacho --- diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c index 91a42cd4af..ce4bdc82d2 100644 --- a/gdk/gdkseatdefault.c +++ b/gdk/gdkseatdefault.c @@ -115,8 +115,10 @@ gdk_seat_default_grab (GdkSeat *seat, GdkSeatDefaultPrivate *priv; guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME; GdkGrabStatus status = GDK_GRAB_SUCCESS; + gboolean was_visible; priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat)); + was_visible = gdk_window_is_visible (window); if (prepare_func) (prepare_func) (seat, window, prepare_func_data); @@ -163,10 +165,12 @@ gdk_seat_default_grab (GdkSeat *seat, { if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD) gdk_device_ungrab (priv->master_pointer, evtime); - gdk_window_hide (window); } } + if (status != GDK_GRAB_SUCCESS && !was_visible) + gdk_window_hide (window); + G_GNUC_END_IGNORE_DEPRECATIONS; return status;